package org.yangspring.samples.mvc.domain;

import javax.persistence.*;

/**
 * Created by whyang on 2017/06/19.
 */

@Entity
@Table(name = "T_animals")
@Inheritance(strategy = InheritanceType.JOINED)
/****
 * InheritanceType.JOINED继承策略为时，
 * 不需要Discriminator相关功能
 * **/
//@DiscriminatorColumn(name = "Gang", discriminatorType = DiscriminatorType.STRING, length = 32)
//@DiscriminatorValue("Gang*")
public class AnimalJoin {

    @Id
    @Column(name = "anmlId")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private long animalId;

    @Column(name = "name", nullable = false)
    private String animalName;

    @Column(name = "color", nullable = false)
    private String animalColor;


    public void setAnimalId(int id){
        this.animalId = id;
    }
    public long getAnimalId(){
        return this.animalId;
    }

    public void setAnimalName(String name){
        this.animalName = name;
    }
    public String getAnimalName(){
        return this.animalName;
    }

    public void setAnimalColor(String color){
        this.animalColor = color;
    }
    public String getAnimalColor(){
        return this.animalColor;
    }

}
